<?php
session_start();
error_reporting(1);
$url = "http://www.conbrad.com.br/_adminconbrad/";

include_once "../controle/db.php";
include_once "../controle/classe_inscricao.php";
include_once "../controle/valida.php";
include_once "classe_retorno.php";
include_once "controle.php";

if($_GET["sair"] == 1){
    deslogar();
    header("location:".$url);
}

$pag = $_GET["pag"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="shortcut icon" href="../imagens/favicon.png">
        <link rel="stylesheet" href="../css/style.css" type="text/css" media="all">
		<link rel="stylesheet" href="css/style.css" type="text/css" media="all"> 
        <title>Admin Conbrad</title>
    </head>
    <body>
        <div id="center">
				<a href="index.php"><img src="../imagens/logo.png" alt="Conbrad" id="logo"></a>
				<div id="titulo1">
					<h1>CONGRESSO BRASILEIRO<br>DE ADMINISTRAÇÃO</h1>
				</div>
				<?php if(logado()){ ?>
				<div id="adm_menu">
					<ul>
						<li><a href="<?=$url."?pag=insc"?>"><span>Inscrições</span></a></li>
                                                <li><a href="<?=$url."?pag=art"?>"><span>Artigos</span></a></li>
						<li><a href="<?=$url."?pag=upload"?>"><span>Upload do arquivo de Retorno</span></a></li>
                                                <li><a href="<?=$url."?sair=1"?>" text="Sair" id="sair">Sair</a></li>
					</ul>
				</div>
            <div id="corpo">			
                <?php
                switch($pag){
                    case "insc": include "view/inscricoes.php"; break;
                    case "art": include "view/artigos.php"; break;
                    case "upload": include "view/upload.php"; break;
                    default: include "view/inscricoes.php"; break;
                }
                ?>
            </div>
            <?php }else{
                include_once "view/login.php";
            } ?>
        </div>
    </body>    
</html>
